var notIE6 = true;
var $document = $(document);
if ($.browser.msie && $.browser.version.substr(0,1)<7) {
    notIE6 = false;
}
var _settings = { mask: { color: '#000', loadSpeed: 400, opacity: 0.85 }, close: '.closeModal', closeOnClick: true, left: 'center', top: 'center', oneInstance: true, fixed: notIE6, onBeforeLoad: function () {} };
$('a.modal').each(function(i){
    $('body').append('<div id="overlay'+i+'"></div>');
    $('div#overlay'+i).hide();
    var toload = $(this).attr('href') + ' .genericmodal';
    $('div#overlay'+i).load(toload, function(){
        $(this).overlay(_settings);
    });
});
$('a.modal').click(function(e){
    var i = $('a.modal').index(this);
    $('div#overlay'+i).overlay().load();
    e.preventDefault();
});
$document.ready(function(){
	var _settings2 = {mask:{ color: '#000', loadSpeed: 300, opacity: 0.85 }, close: '.closeModal', closeOnClick: true, left: 'center', top: 'center', oneInstance: true, fixed: notIE6, onLoad: function () { $.mask.load(); }};
	$('body').append('<div id=\"overlay6\"><\/div><div id=\"overlay7\"><\/div>');
	$('#overlay6, #overlay7').hide();
	$('#overlay6').load('modal-addbidconfirm.html', function(){
		$(this).overlay(_settings2);
	});
	$('#overlay7').load('modal-passwordconfirm.html', function(){
		$(this).overlay(_settings2);
	});
});
$('.btnModBuyNow').live('click', function(){
	$('#overlay6').overlay().load();
    event.preventDefault();
});
$('#resetPassForm .btnSubmit').live('click', function () {
	event.preventDefault();
	$('#overlay7').overlay().load();
	var form = $('#resetPassForm');
	window.setTimeout(function() {
	form.submit();
	}, 3000);
});
